<?php 

include_once dirname(__FILE__)."/../util/MysqlUtil.php";


/**
* 
*/
class ActivityModel 
{	
	
	// 通过id 获取活动信息
	static function info($acid){

		$sql="select id,organization,name,startDay,startHour,startMinute,endDay,endHour,endMinute,linkman,connectWay,address,province,city,district,needs,signCount 
		FROM activity WHERE id=$acid";

		$mysql=new MysqlUtil();

		$data=$mysql->query($sql);

		if(empty($data)) return array();

		return $data[0];

	}


	//获得活动所属组织编号
	static function getOrgId($acid){

		$sql="select organization as orgid FROM activity WHERE id=$acid";

		$mysql=new MysqlUtil();

		$data=$mysql->query($sql);

		if(empty($data)) return 0;

		return $data[0]["orgid"];

	}
}


